<html>
	<script src="js-lib/jquery-1.8.0.js"></script>
	<script src="js-lib/util.js"></script>
	<script src="js/model.js"></script>
	<script src="js/controller.js"></script>
	<script src="js/view.js"></script>
	
	<script type="text/javascript">
		function main(){
			var user = <%= request.getParameter("_user") %>;
			
			var loginController = new LoginController(user);
			var requestController = new RequestController(loginController);
			
			if(user){
				loginController.loggedIn(user);
			}
		}
	</script>
	
	<body onload='main()'>
		<h2>Api client<span id="versionDiv" style="font-size: 10pt"> </span></h2>
		<form id="login">
			<select id='scheme'>
				<option value="https">https</option>
				<option value="http">http</option>
			</select>
			<select id='environment'>
				<option value="0">Select an environment</option>
			</select>
			Username : 
			<input type="text" name="username"/>  Password : 
			<input type="password" name="password"/>
			<input type="submit" value='Login' />
			<a id="newRequestLink" href="#" style="font-size: 10pt">New request</a>
			<br/>
			<br/>
			<label></label>
		</form>
		<form id="loggedIn" method="post" action="index.jsp" target="_blank"><input name="_user" type="hidden" /></form>
		<form id="apiService">
			<select id='api'>
				<option value="0">Select api</option>
			</select>
			<select id='service'>
				<option value="0">Select service</option>
			</select>
		</form>
		<form id="request" method="POST" target="_blank">
			<label></label> <a href="" id="javadocLink" target="_blank">javadoc</a>
			<br>
			<br>
			<table id="fields"></table>
			<br>
			<input type="hidden" />
			<input type="checkbox" id="iterationCheck"/>Iterative: <input type="text" id="iterationFrom" value='0' size="1"/> to <input type="text" id="iterationTo" value='1' size="1"/>    
			<input type="submit" value='Send Request' />
		</form>
	</body>
</html>
